﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Diagnostics;
using Redbrick.Silverlight.Common;

namespace Moria.Silverlight.Views
{
	public partial class Home : MoriaPage
	{
		private static Lazy<Uri> myUri = new Lazy<Uri>(() => new Uri("", UriKind.Relative));

		public Home()
		{
			this.DebugMethodInfo();
			InitializeComponent();
		}

		// Executes when the user navigates to this page.
		protected override void OnNavigatedTo(NavigationEventArgs e)
		{
			this.DebugMethodInfo(e);
			base.OnNavigatedTo(e);
			if (this.Moria.Player == null || !this.Moria.Player.IsGenerated)
			{
				this.NavigationService.Navigate(NewGame.Uri);
			}
			else
			{
				this.NavigationService.Navigate(GameBoard.Uri);
			}
		}

		public static Uri Uri { get { return myUri.Value; } }

	}
}